package com.yonyou.cyxdms.sysAuth.service.controller;

import com.yonyou.cyx.framework.controller.base.BaseController;
import com.yonyou.cyx.framework.util.bean.ApplicationContextHelper;
import com.yonyou.cyxdms.framework.bean.dto.user_info.LoginInfoDto;
import com.yonyou.cyxdms.sysAuth.service.service.TtUserLoginService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author 李贺
 * @since 2019-12-10
 */
@RestController
@RequestMapping("/ttUserLogin")
public class TtUserLoginController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(TtUserLoginController.class);

    @Autowired
    public TtUserLoginService ttUserLoginService;

    /**
     * 更新登录信息
     * 2019/12/10
     * @param id
     */
    @PutMapping("/upLog")
    public void upLog(@RequestParam("id") Long id, @RequestParam(value = "jwt",required = false)String jwt,@RequestParam(value = "type",defaultValue = "10041002") Integer type) {
        LoginInfoDto loginInfoDto = ApplicationContextHelper.getBeanByType(LoginInfoDto.class);
        ttUserLoginService.upLog(id,jwt,type,loginInfoDto);
    }
}
